package cn.tansanqinger.DesignMode.Singleton;
class Message1{
    private Message1(){
        System.out.println("构造方法");
    }
    private static Message1 message1 = new Message1();
    public static Message1 getInstance(){
        return message1;
    }
    public void printf(){
        System.out.println("C3H2");
    }
}
public class EagerSingleton {
    public static void main(String[] args) {
        Message1 messageA = Message1.getInstance();
        Message1 messageB = Message1.getInstance();
        messageA.printf();
        messageB.printf();
    }
}
